package com.sd.repay.service;

import java.util.List;
import java.util.Map;

public interface ActivateService {

    /**
     * 生成激活码
     *
     * @param length
     * @return
     */
    boolean genertateActivateCode(int length, String oemType) throws Exception;

    /**
     * 根据编码获取激活码
     *
     * @param code
     * @return
     */
    Map<String, Object> getActivateByCode(String code) throws Exception;

    /**
     * 根据代理商编号获取激活码
     *
     * @param agentNo
     * @return
     */
    List<Map<String, Object>> getActivateByAgentNo(String agentNo) throws Exception;

    /**
     * 根据商户号号获取激活码
     *
     * @param merNo
     * @return
     */
    Map<String, Object> getActivateByMerNo(String merNo) throws Exception;

    /**
     * 根据序列号范围获取激活码
     *
     * @param beginIndex
     * @param endIndex
     * @return
     */
    List<Map<String, Object>> getActivateByIndex(int beginIndex, int endIndex) throws Exception;

    /**
     * 分配激活码
     *
     * @param agentNo
     * @param beginIndex
     * @param endIndex
     * @return
     */
    int allotActivateCode(String agentNo, String agentNode, String oneAgentNo, int beginIndex, int endIndex) throws Exception;

    /**
     * 激活码激活
     *
     * @param merchantNo
     * @param code
     * @return
     */
    int activateCode(String merchantNo, String code) throws Exception;

    /**
     * 获取最大序列号
     *
     * @return
     * @throws Exception
     */
    Integer getMaxActivateIndex() throws Exception;
}
